package com.sxyjhh.dbutil.meta;

import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * Description:表元数据类
 *
 * @JDK Version:1.8.0_40
 * Version: V1.0
 * Author: wangchun
 * Date: 2016/3/29 10:05
 */
@Data
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class TableMetaData {

    private String name;
    private String remark;
    private String relTabId;

    private List<ForeignKeyMetaData> foreignKeys;
    private List<ColumnMetaData> columns;
    private List<PrimaryKeyMetaData> primaryKeys;

    public TableMetaData(String name, List<ForeignKeyMetaData> foreignKeys, List<ColumnMetaData> columns, List<PrimaryKeyMetaData> primaryKeys) {
        this.name = name;
        this.foreignKeys = foreignKeys;
        this.columns = columns;
        this.primaryKeys = primaryKeys;
    }

    public TableMetaData(String name, List<PrimaryKeyMetaData> primaryKeys) {
        this.name = name;
        this.primaryKeys = primaryKeys;
    }

    public TableMetaData(String name, String remark) {
        this.name = name;
        this.remark = remark;
    }


    @Override
    public String toString() {
        return "{tableName=" + name + '}';
    }

}